﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Chianti.Service.Types;
using Chianti.Service.Types.Enumeration;

namespace Chianti.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IDealManagementService
    {

        
        [OperationContract]
        string GetData(int value);

        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);


        [OperationContract]
        void DeleteBusiness(long businessID);

        [OperationContract]
        bool IsDealActive(long dealID);

        [OperationContract]
        long CreateBusiness(Business newBusiness);

        [OperationContract]
         CreateDealResponse CreateDeal(Deal newDeal, double bidAmount, int radiusInMeters);

        [OperationContract]
         void UpdateDeal(Deal updatedDeal);

        [OperationContract]
         void DeleteDeal(long dealID);

        [OperationContract]
         Deal GetDeal(long dealID);

        [OperationContract]
        DealBid GetDealBid(long dealID);

        [OperationContract]
        UpdateDealBidResponse UpdateDealBid(long dealID, double newBid, int newBidRadius); 

        [OperationContract]
         List<DealEnumerationResult> FindDealHeadings(Position longitude, Position latitude, int radius, int maxResults);
        
        [OperationContract]
         DealMetric GetDealMetrics(long dealID);

        [OperationContract]
        List<Business> FindBusinessesByName(string name, int maxResults);

        [OperationContract]
        List<Business> GetBusinesses(List<long> businessIDs);

        [OperationContract]
        List<DealBid> GetDealBids(List<long> dealIDs);

        [OperationContract]
        List<Deal> FindActiveDeals(Position longitude, Position latitude, int radius, int maxResults);

        [OperationContract]
        Business GetBusiness(long businessID);
        // TODO: Add your service operations here
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
}
